
(function () {
    var core = ecui,
        util = core.util,
        ui = ecui.ui,
        dom = ecui.dom;

    Object.assign(
        NS.data,
        {
        }
    );
    Object.assign(
        NS.ui,
        {
            VerifySubmit: core.inherits(
                ui.Control,
                function (el, options) {
                    ui.Control.call(this, el, options);
                    this._sOptId = options.optId;
                },
                {
                    onclick: function () {
                        this.disable();
                        ecui.esr.request(
                            'data@POST /erp-management/index/h5/exchange/verification/' + this._sOptId,
                            function () {
                                this.enable();
                                var data = ecui.esr.getData('data');
                                if (data instanceof Object) {
                                    ecui.tip('warn', '礼品核销成功');
                                    history.go(-1);
                                }
                            }.bind(this),
                            function () {
                                this.enable();
                            }.bind(this)
                        );
                    }
                }
            )
        }
    );
    ecui.esr.addRoute('verify', {
        model: ['detail@GET /erp-management/index/h5/exchange/${id}'],
        weight: 2,
        frame: true,
        onbeforerequest: function (context) {
        },
        onbeforerender: function (context) {
        },
        onafterrender: function (context) {
        }
    });
}());

